#include "some.h"
#include <stdint.h>

// Add the following prefix to the exported symbol declarations to ensure they are visible to Dart:
extern "C" __attribute__((visibility("default"))) __attribute__((used))

int32_t native_add(int32_t x, int32_t y) {
  return x + y;
}

char *reverse(char *str, int length)
{
    //动态申请length+1个长度的字符空间
    char *reversed_str = (char *)malloc((length + 1) * sizeof(char));
    //简单的倒置算法
    for (int i = 0; i < length; i++)
    {
        reversed_str[length - i - 1] = str[i];
    }
    //这行很关键，切记，让它最后一个为\0
    reversed_str[length] = '\0';
    return reversed_str;
}





